<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        (function(){
            var btn = document.querySelector('#btn');
            var img = document.querySelector('#img');
            btn.onclick = function(){
                console.log("this",this);
                if(this.innerHTML == "开"){
                    img.src="img/pic_bulbon.gif";
                    this.innerHTML = "关";
                    this.style.backgroundColor = "green";
                }else{
                img.src="img/pic_bulboof.gif"};
                this.innerHTML = "开";
                this.style.backgroundColor = "#ddd";
            }
        }());
    </script>
</body>
</html>